@extends('home.common.layout')

@section('title', '文章归档')

@section('content')
    <div class="archives">
        <div class="title-page">
            <h3><i class="layui-icon">&#xe653;</i> 文章归档</h3>
            <p>目前共计 <em>{{ $articleCount }}</em> 篇日志，共 <em>{{ $commentCount }}</em> 条评论，加油啊~</p>
        </div>
        <ul class="layui-timeline">
            @foreach($articleGroups as $articleGroup)
                <li class="layui-timeline-item">
                    <i class="layui-icon layui-timeline-axis">&#xe63f;</i>
                    <div class="layui-timeline-content">
                        <h3 class="layui-timeline-title"><a
                                    href="javascript:void(0)">{{ date(" Y 年 m 月",strtotime($articleGroup['showtime'])) }}</a>
                        </h3>
                        @foreach($articleGroup['articles'] as $article)
                            <p><a href='{{url("/article/{$article['id']}")}}'
                                  title='{{$article['title']}}'>{{$article['title']}}
                                    <small><i class='layui-icon'>&#xe637;</i> {{substr($article['created_at'],8,2)}} 日发布，共 {{$article['comment_count']}} 条评论
                                    </small>
                                </a></p>
                        @endforeach
                    </div>
                </li>
            @endforeach
        </ul>
    </div>
@endsection